package com.suep.system.mapper;

import com.suep.system.domain.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface RoleMapper {

    //返回用户角色
    @Select("SELECT * FROM `role` where id=(SELECT `role_id` FROM `user_role` WHERE `user_id` = #{userId})")
    Role selectRoleByUserId(Long userId);
    //通过角色名来查询用户信息
    @Select("SELECT * FROM `role` where name=#{roleName}")
    Role selectRoleByName(String roleName);
}
